import { stringify } from 'qs';
import request from '../utils/request';

export async function queryFenzuListForZubie(code) {
  return request(`/gameProjectZubieFenzu/zubie/${code}`, {
    method: 'GET',
  });
}

export async function queryZubieByCode(code) {
  return request('/gameZubie/code/' + code, {
    method: 'GET',
  });
}

export async function changeZubieStatus(payload) {
  const { zubieCode, status } = payload;
  return request(`/gameZubie/changeZubieStatus/${zubieCode}/${status}`, {
    method: 'POST',
  });
}

export async function beginChouqian(payload) {
  const { zubieCode } = payload;
  return request(`/gameZubie/beginChouqian/${zubieCode}`, {
    method: 'POST',
  });
}

export async function cancelChouqian(payload) {
  const { zubieCode } = payload;
  return request(`/gameZubie/cancelChouqian/${zubieCode}`, {
    method: 'POST',
  });
}

export async function queryPosition(code) {
  return request('/gamePosition/getByZubieCode/' + code, {
    method: 'GET',
  });
}

export async function autoChouqian(zubieCode) {
  return request(`/gameZubie/autoChouqian/${zubieCode}`, {
    method: 'POST',
  });
}

export async function queryChouqian(zubieCode) {
  return request(`/gameUserGroup/getChouqianForZubie/${zubieCode}`, {
    method: 'GET',
  });
}

export async function queryZhixu(zubieCode) {
  return request(`/gameSchedule/getZhixuForZubie/${zubieCode}`, {
    method: 'GET',
  });
}

export async function queryAllZubieForGame(code) {
  return request('/gameZubie/getALLZubie/' + code, {
    method: 'GET',
  });
}

export async function modifyScore(payload) {
  return request(`/gameScore/saveOrUpdate`, {
    method: 'POST',
    body: payload,
  });
}

export async function findScores(payload) {
  return request(`/gameScore/game/${payload}`, {
    method: 'GET',
  });
}
